package com.ptu.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.deser.std.NumberDeserializers;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;


public class OrderDTO {
    private Long addressId;
    private List<OrderItemDTO> orderItems;
    private String paymentMethod;
    private String remark;
    @JsonDeserialize(using = NumberDeserializers.BigDecimalDeserializer.class)
    private BigDecimal totalAmount;

    @JsonDeserialize(using = NumberDeserializers.BigDecimalDeserializer.class)
    private BigDecimal actualAmount;// 实付金额

    public OrderDTO() {
    }

    public OrderDTO(Long addressId, List<OrderItemDTO> orderItems, String paymentMethod, String remark, BigDecimal totalAmount, BigDecimal actualAmount) {
        this.addressId = addressId;
        this.orderItems = orderItems;
        this.paymentMethod = paymentMethod;
        this.remark = remark;
        this.totalAmount = totalAmount;
        this.actualAmount = actualAmount;
    }

    public Long getAddressId() {
        return addressId;
    }

    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }

    public List<OrderItemDTO> getOrderItems() {
        return orderItems;
    }

    public void setOrderItems(List<OrderItemDTO> orderItems) {
        this.orderItems = orderItems;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getActualAmount() {
        return actualAmount;
    }

    public void setActualAmount(BigDecimal actualAmount) {
        this.actualAmount = actualAmount;
    }

    @Override
    public String toString() {
        return "OrderDTO{" +
                "addressId=" + addressId +
                ", orderItems=" + orderItems +
                ", paymentMethod='" + paymentMethod + '\'' +
                ", remark='" + remark + '\'' +
                ", totalAmount=" + totalAmount +
                ", actualAmount=" + actualAmount +
                '}';
    }
}
